package com.whw.fy.service.impl;

import com.whw.fy.entity.Message;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.whw.fy.entity.Area;
import com.whw.fy.mapper.AreaMapper;
import com.whw.fy.service.AreaService;import java.util.List;

@Service
public class AreaServiceImpl implements AreaService {

    @Resource
    private AreaMapper areaMapper;

    @Override
    public Message deleteByPrimaryKey(Integer areaId) {
        return areaMapper.deleteByPrimaryKey(areaId) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message insert(Area record) {
        return areaMapper.insert(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message insertSelective(Area record) {
        return areaMapper.insertSelective(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message selectByPrimaryKey(Integer areaId) {
        return Message.success(null).add(areaMapper.selectByPrimaryKey(areaId));
    }

    @Override
    public Message updateByPrimaryKeySelective(Area record) {
        return areaMapper.updateByPrimaryKeySelective(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message updateByPrimaryKey(Area record) {
        return areaMapper.updateByPrimaryKey(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message selectAll() {
        return Message.success(null).add(areaMapper.selectAll());
    }


}



